<template>
  <div id="home">
    <NavBar class="home_nav">
      <template v-slot:navBar_center>购物街</template>
    </NavBar>
    <HomeSwiper :banner="banner" />
  </div>
</template>

<script>
import NavBar from '@/components/common/NavBar'
import HomeSwiper from './child/HomeSwiper'

export default {
  name: 'Home',
  components: {
    NavBar,
    HomeSwiper
  },
  created () {
    this.getHomeMultidata()
  },
  data () {
    return {
      banner: [] // 轮播图数据
    }
  },
  methods: {
    async getHomeMultidata () {
      const res = await this.$api.getHomeMultidata()

      this.banner = res.data.banner.list
    }
  }
}
</script>

<style lang="scss" scoped>
.home_nav {
  background-color: $--color-tint;
  color: #fff;
}
</style>
